/*
 * @(#)WebModuleMBean.java $version 2010. 8. 11
 *
 * Copyright 2007-2010 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nhncorp.usf.core.jmx;

import java.util.Map;

/**
 * USF 로딩 된 JVM에 대한 MBean interface이다.
 * <p/>
 * <h4>이 MBean의 ObjectName의 요소</h4>
 * <ul>
 * <li>domain key의 값 : USF
 * <li>name key의 값 : Context Name
 * <li>type key의 값 : URI
 * </ul>
 * <p/>
 *
 * @author Web Platform Development Team
 */
public interface WebModuleMBean {
    public String TYPE = "URI";
    public String REQCOUNT_ITEM_PREFIX = "USF#ReqCount";
    public String REQTIME_ITEM_PREFIX = "USF#ReqTime";
    public String ERRORCODE_ITEM_PREFIX = "USF#E_USF_";
    public String STATUS_TYPE = "A";
    public String SEPERATOR_TYPE = "#";

    /**
     * web application context name
     *
     * @return the server context name
     */
    String getName();

    /**
     * 웹 모듈에 대한 통계 정보 리턴
     *
     * @return the context statistic data
     */
    @SuppressWarnings("unchecked")
	Map stat();

    /**
     * Sets the req time.
     *
     * @param uri      the uri
     * @param newValue the new value
     */
    void setReqTime(String uri, long newValue);

    /**
     * Sets the req count.
     *
     * @param uri the new req count
     */
    void setReqCount(String uri);

    /**
     * Put result code count.
     *
     * @param uri the uri
     * @param key the key
     */
    void putResultCodeCount(String uri, String key);

    /**
     * Clear.
     */
    void clear();
}
